package cn.echoparrot.repository.neo4j;

import cn.echoparrot.domain.entity.Notebook;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface NotebookRepository extends Neo4jRepository<Notebook, Long> {
    
    Optional<Notebook> findByDeviceIdAndRoleId(String deviceId, Integer roleId);
    
    List<Notebook> findByDeviceId(String deviceId);
    
    List<Notebook> findByModelId(int modelId);
    
    void deleteByDeviceIdAndRoleId(String deviceId, int roleId);
}